"use strict"
/**
 * 视图
 * @param {import("egg").Application} app
 */
module.exports = function (app) {
	const DataTypes = app.Sequelize
	const sequelize = app.model
	return sequelize.define("empire_user_view", {
		headimg_url: {
			type: DataTypes.STRING(255),
			allowNull: true
		},
		oid: {
			type: DataTypes.INTEGER,
			allowNull: true,
			primaryKey: true
		},
		inviteid:{
			type: DataTypes.INTEGER,
		},
		openid: {
			type: DataTypes.STRING(30),
			allowNull: true
		},
		unionid: {
			type: DataTypes.STRING(40),
			allowNull: true
		},
		nickname: {
			type: DataTypes.STRING(50),
			allowNull: true
		},
		invitedName: {
			type: DataTypes.STRING(50),
			allowNull: true
		},
		total_coin: {
			type: DataTypes.DOUBLE,
			allowNull: true,
			defaultValue: "0"
		},
		popularity: {
			type: DataTypes.DOUBLE,
			allowNull: true,
			defaultValue: "0"
		},
		sycee: {
			type: DataTypes.INTEGER,
			allowNull: true,
			defaultValue: "0"
		},
		ip: {
			type: DataTypes.INTEGER.UNSIGNED,
			allowNull: true
		},
		sex: {
			type: DataTypes.TINYINT,
			allowNull: true
		},
		create_at: {
			type: DataTypes.DATE,
			allowNull: true
		},
		last_login: {
			type: DataTypes.DATE,
			allowNull: true
		}
	}, {
		tableName: "empire_user_view",
		timestamps: false
	})
}
